// src/entities/user-session.entity.ts
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('user_sessions')
export class UserSession {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({ length: 50 })
  region: string; // "Beijing", "Shanghai", "US-West"

  @Column({ length: 20 })
  deviceType: 'PC' | 'Mobile' | 'Tablet';

  @Column({ length: 100, nullable: true })
  pageVisited: string;

  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
  loginAt: Date;
}
